package com.luna.consumer.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    RestTemplate restTemplate;

    @GetMapping("/cloud/{name}")
    public String buyTicket(@PathVariable("name") String name){
        String s = restTemplate.getForObject("http://CLOUD-PROVIDER/cloud/"+name, String.class);
        return name+"调用了"+s;
    }
}
